<?php

namespace App;

use App\Http\Controllers\Controller;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password', 'avatar', 'confirm_token', 'register_time', 'register_ip', 'login_last_ip'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * 发送重置密码邮件
     * @param string $token
     */
    public function sendPasswordResetNotification($token){
        app('App\Services\EmailService')->sendCloudEmail('find_password', $this->email, ['url' => url('password/reset', $token)]);

    }



}
